var GameData = require('../../module/GameData')();
var hero_list_Data = require('./hero_list_Data')();


cc.Class({
    extends: cc.Component,

    properties: {

        dan_level: {
            default: null,
            type: cc.Label,
            tooltip: '段位等级',
        },
        own_grade_sp: {
            default: null,
            type: cc.Sprite,
            tooltip: '达到的熟练度积分图标',
        },
        own_grade_num: {
            default: null,
            type: cc.Label,
            tooltip: '达到的熟练度积分',
        },
        own_grade_Allnum: {
            default: null,
            type: cc.Label,
            tooltip: '达到的当前段位最高熟练度积分',
        },
        hero_icon: {
            default: null,
            type: cc.Sprite,
            tooltip: '当前英雄图标',
        },
        weplon_icon: {
            default: null,
            type: cc.Sprite,
            tooltip: '当前武器的图标',
        },
        hero_name: {
            default: null,
            type: cc.Label,
            tooltip: '当前英雄的名字',
        },
        hero_level: {
            default: null,
            type: cc.Label,
            tooltip: '当前英雄的等级',
        },
        own_hero_icon: {
            default: null,
            type: cc.Sprite,
            tooltip: '拥有此英雄碎片图标',
        },
        own_hero_num: {
            default: null,
            type: cc.Label,
            tooltip: '拥有此英雄碎片的数量',
        },
        own_hero_Allnum: {
            default: null,
            type: cc.Label,
            tooltip: '拥有此英雄多少碎片可以合成一个',
        },
        own_grade_progress:{
            default: null,
            type: cc.Node,
            tooltip: '拥有的该英雄熟练度的进度条',
        },
        own_hero_progress:{
            default: null,
            type: cc.Node,
            tooltip: '拥有的英雄碎片的进度条',
        },
        hero_All:cc.SpriteAtlas,

    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start() {

    },
    init(data){
        this.dan_level.string=data.level;
        this.own_grade_num.string=data.grade_num;
        this.own_grade_Allnum.string=data.grade_Allnum;

        this.hero_name.string=data.name;
        this.hero_level.string=data.hero_level;

        this.own_hero_num.string=data.hero_num;
        this.own_hero_Allnum.string=data.hero_Allnum;


        this.hero_icon.getComponent(cc.Sprite).spriteFrame=this.hero_All.getSpriteFrame(data.hero);
        this.weplon_icon.getComponent(cc.Sprite).spriteFrame=this.hero_All.getSpriteFrame(data.weplon);

    },
    selectbtn(){
        cc.find("Canvas/main").active=false;
        GameData.hero_layer.title.string=hero_list_Data.title1;
        cc.find("Canvas/hero_property").active=true;


    },
    // update (dt) {},
});
